package com.star.utils;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.star.entity.User;
import com.star.mapper.UserMapper;
import com.star.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author star
 * @Date 2023/4/7 8:54
 * @PackageName:com.star.utils
 * @ClassName: Userautomatic
 * @Description: TODO
 * @Version 1.0
 */

public class UserAutomaticUtil {

    /**
     * 自动注册用户,生成默认用户名和密码
     * @param phone
     * @return
     */
    public static User autoUser(String phone){
        User user = new User();
        user.setUsername("用户"+phone);
        user.setPassword("123");
        user.setPhone(phone);
        return user;
    }

    /**
     * 使用邮箱
     * 自动注册用户,生成默认用户名和密码
     * @param email
     * @return
     */
    public static User emailAutoUser(String email) {
        User user = new User();
        user.setUsername("用户"+email);
        user.setPassword("123");
        user.setEmail(email);
        return user;
    }
}
